package com.sinosoft.zyemr.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sinosoft.zyemr.entity.PatientEntity;
import com.sinosoft.zyemr.manager.PatientManager;



@Service
public class PatientService {
	
	/**病人管理类*/
	@Autowired
	private PatientManager patientManager; 
	
	/**
     * 增加病人信息
     * @param patient
     * @return
     */
    public int insertSelective(PatientEntity patient){
    	return patientManager.insertSelective(patient);
    }
	/**
	 * 根据主键查询
	 *//*
	public PatientEntity getPatientById(String patientid){
		return patientManager.getPatientById(patientid);
	}

	*//**
	 * 查询出所有记录
	 *//*
	public List<PatientEntity> findAllPatient(){
		return patientManager.findAllPatient();
	}

	*//**
	 * 保存
	 *//*
	public int savePatient(PatientEntity patient){
		return patientManager.savePatient(patient);
	}
	
	*//**
	 * 保存
	 *//*
	public boolean savePatients(List<PatientEntity> patients){
		boolean bReturn = false; 
		int size = patients.size();
		for(int i=0; i<size; i++) {
			patientManager.savePatient((PatientEntity)patients.get(i));
			bReturn = true; 
		}
		return bReturn;
	}

	*//**
	 * 根据主键更新（参数对象中的主键将作为更新条件）
	 *//*
	public int updatePatient(PatientEntity Patient){
		return patientManager.updatePatient(Patient);
	}

	*//**
	 * 根据主键删除
	 *//*
	public int deletePatient(String patientid){
		return patientManager.deletePatient(patientid);
	}


	public PatientEntity getPatientByUserId(String userId){
		return patientManager.getPatientByUserId(userId);
	}*/
}
